package com.yanqu.road.server.cmd.musicroom;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.MusicRoomProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.musicroom.MusicRoomModule;
import com.yanqu.road.server.gameplayer.module.player.PlayerModule;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_MUSIC_ROOM_GUIDE_UPDATE, desc = "妙音坊 引导更新")
public class MusicRoomGuideUpdateCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        MusicRoomProto.MusicRoomGuideUpdateReqMsg msg = MusicRoomProto.MusicRoomGuideUpdateReqMsg.parseFrom(packet.getBytes());
        player.getModule(PlayerModule.class).getUserHistoryAttribute().setMusicRoomGuide(msg.getGuideData());
        player.sendPacket(ClientProtocol.U_MUSIC_ROOM_GUIDE_UPDATE, MusicRoomProto.MusicRoomGuideUpdateRespMsg.newBuilder().setGuideData(msg.getGuideData()));
    }

    @Override
    public void sendData(GamePlayer player) {
    }
}
